import Vue from 'vue';

export default Vue.extend({
          
        methods:{
                adLink(d:any){
                   
                    let {adRedictUrl,id} = d;
                    let reg = /^\//;
                
                    if(!adRedictUrl ) return;

                
                    if(adRedictUrl.indexOf('brand') >= 0){
                             
                        return uni.navigateTo({
                            url:`/detailPackages/pages/groundPage/index?id=${id}`
                        })

                    }else if(/\?/gi.test(adRedictUrl)){

                        
                            return uni.navigateTo({
                                url: adRedictUrl
                            })
                        


                    }else{
                        return uni.switchTab({
                                url: adRedictUrl,
                                fail:(err:any)=>{
                                    console.log(err)
                                }
                            })
                    
                    }

               }
        }

})